<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of _tablelist
 *
 * @author Chris Sim
 */
?>
<table class="dataGrid">
  <tr>
    <th><?php echo $sort->link('id'); ?></th>
    <th><?php echo $sort->link('ref_no'); ?></th>
    <th><?php echo $sort->link('in_date'); ?></th>
    <th><?php echo $sort->link('out_date'); ?></th>
    <th><?php echo $sort->link('qty'); ?></th>
    <th><?php echo $sort->link('wt'); ?></th>
    <th><?php echo $sort->link('m3'); ?></th>
    <th><?php echo $sort->link('con_id'); ?></th>
    <th><?php echo $sort->link('cus_id'); ?></th>
	<th>Actions</th>
  </tr>
<?php foreach($models as $n=>$model): ?>
  <tr class="<?php echo $n%2?'even':'odd';?>">
    <td><?php echo CHtml::link($model->id,array('show','id'=>$model->id)); ?></td>
    <td><?php //echo CHtml::encode($model->ref_no); ?></td>
    <td><?php //echo CHtml::encode($model->in_date); ?></td>
    <td><?php //echo CHtml::encode($model->out_date); ?></td>
    <td><?php //echo CHtml::encode($model->qty); ?></td>
    <td><?php //echo CHtml::encode($model->wt); ?></td>
    <td><?php //echo CHtml::encode($model->m3); ?></td>
    <td><?php echo CHtml::encode($model->con_id); ?></td>
    <td><?php echo CHtml::encode($model->cus_id); ?></td>
    <td>
      <?php echo CHtml::link('Update',array('update','id'=>$model->id)); ?>
      <?php echo CHtml::linkButton('Delete',array(
      	  'submit'=>'',
      	  'params'=>array('command'=>'delete','id'=>$model->id),
      	  'confirm'=>"Are you sure to delete #{$model->id}?")); ?>
	</td>
  </tr>
<?php endforeach; ?>
</table>
<?php $this->widget('CLinkPager',array('pages'=>$pages)); ?>

<?php
    $cs = Yii::app()->getClientScript();
    $script = '$("table.dataGrid>tr>th").each(function(i){$(this).html("testing")})';
    $cs->registerScript("testing",$script);
?>